#!/bin/bash
###
 # @Version: 2.0
 # @Author: Yue Zhong
 # @Date: 2024-11-11 16:51:52
 # @Description: 
 # @LastEditors: Yue Zhong
 # @LastEditTime: 2025-01-06 21:50:35
### 

gpu=0
dataset_dir='./data'

search_mode=random ## WS + random search (in Table 5)
# search_mode=LLM #evolution ## AutoSNN
dataset_name=SVHN
batch_size=96
## This super-network will be generated after executing 1_script_train_supernet.sh
T=8
channels=64
# avg_num_spikes=556000
suffix='_SNN_Adam_600ep_2022/batch_size_'$batch_size'/checkpoint.pth.tar'
search_space=AutoSNN_$channels
prefix='macro_search_result2/uniform_sampling/'$search_space'_'
trained_supernet=$prefix$dataset_name$suffix

python search_arch/search.py \
    --gpu $gpu \
    --T $T --init_tau 2.0 --v_threshold 1.0 --neuron PLIF \
    --dataset_dir $dataset_dir \
    --dataset_name $dataset_name \
    --supernet $trained_supernet \
    --seed 2022 \
    --search_space $search_space \
    --search_algo $search_mode \
    --fitness ACC_pow_spikes \
    --fitness_lambda -0.08 \
    --max_search_iter 20 \
    --task_id 1
    # --avg_num_spikes $avg_num_spikes

echo "Searching AutoSNN on $dataset_name is completed"
